<template>
  <div>
    <ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media" v-for="item in result" :key="item.id">
					<router-link :to="'/newList/newsInfo/'+item.id" >  
						<img class="mui-media-object mui-pull-left" :src="item.img_url">
						<div class="mui-media-body">
							{{item.title}}
							<p class="mui-ellipsis">
              <span>发表时间:{{item.add_time | fmtTime('YYYY-MM-DD hh:mm:ss')}}</span>
              <span>查询次数:{{item.click}}</span>
              </p>
						</div>
					</router-link>
				</li>
			</ul>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  data () {
    return {
       result:[],
    }
  },

  methods: {
     initList(){
       axios.get(`/api/getnewslist`).then(res=>{
       console.log(res)
       if(res.status===200){
         this.result=res.data.message
       }
        
       })
     }
  },

  created () {
    this.initList()
  }
}
</script>

<style lang='scss'>
.mui-media-body{
  font-weight: 700;
  color: #000;
  font-size: 14px;
}
.mui-ellipsis{
  font-size: 14px;
  font-weight: 200;
  color: #26a2ff;
  display: flex;
  justify-content: space-between;
}
</style>
